<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  created() {
    this.$actions.onGlobalStateChange && this.$actions.onGlobalStateChange((state, prevState) => {
      // state: 变更后的状态; prevState: 变更前的状态
      console.log("微应用观察者：新值", state.user);
      console.log("微应用观察者：旧值 ", prevState.user);
      this.$store.commit("setUser", state.user)
    },true);
  },
}
</script>

<style lang="scss"  >
* {
  margin: 0;
  padding: 0;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
</style>
